#!/usr/bin/perl



use strict;
use warnings;
use Net::SNMP;
use Net::MAC;

our $ap='10.73.1.249';
our $community="as730";
our $oid=".1.3.6.1.4.1.171.10.37.39.2.1.3.3.4.2.1.2.1.1";

my ($session, $error) = Net::SNMP->session(
	-hostname  => $ap,
	-community => $community,
    -version     => 'snmpv2c',
);

if (!defined $session) {
    printf "ERROR: %s.\n", $error;
    exit 1;
}

my $result = $session->get_request(-varbindlist => [$oid],);

if (!defined $result) {
	printf "ERROR: %s.\n", $session->error();
	$session->close();
	exit 1;
}
my $temp = $result->{$oid};
$temp =~ s/0x//;

my $mac = Net::MAC->new(mac => $temp );


printf "The sysUpTime for host '%s' is %s.\n", $session->hostname(), $mac->as_IEEE();

$session->close();
exit 0;
